#ifndef PRODUCT_EDIT_DIALOG_H
#define PRODUCT_EDIT_DIALOG_H
#include "product.h"
#include <QDialog>

namespace Ui {
class ProductEditDialog;
}

// struct Product {
//     int id = -1;
//     QString name;
//     QString barcode;
//     double price = 0.0;
//     double cost = 0.0;
//     int stockQuantity = 0;
//     int minStock = 10;
//     QString category;
//     QString supplier;
//     QString description;
// };

class ProductEditDialog : public QDialog {
    Q_OBJECT

public:
    explicit ProductEditDialog(QWidget *parent = nullptr, int productId = -1);
    ~ProductEditDialog();

    Product getProductData() const;

private slots:
    void onSaveButtonClicked();
    void onCancelButtonClicked();

private:
    void loadProductData();

private:
    Ui::ProductEditDialog *ui;
    int currentProductId;
};

#endif // PRODUCT_EDIT_DIALOG_H
